import serves from './axios'
import store from '@/store/index'

// 产品与服务
// 
// 获取产品与服务层级
export function getIndustryList() {
    return serves({
        url: '/admin/getIndustryList',
        method: 'post',
        data: {
            token: store.state.token
        }
    })
}

// 新增产品与服务
export function addIndustry(data) {
    return serves({
        url: '/admin/addIndustry',
        method: 'post',
        data: {
            token: store.state.token,
            ...data
        }
    })
}

// 删除产品与服务
export function delIndustry(id) {
    return serves({
        url: '/admin/delIndustry',
        method: 'post',
        data: {
            token: store.state.token,
            id
        }
    })
}

// 修改产品与服务
export function updateIndustry(data) {
    return serves({
        url: '/admin/updateIndustry',
        method: 'post',
        data: {
            token: store.state.token,
            ...data
        }
    })
}

// 获取产品与服务id
export function getIndustryListByType(type) {
    return serves({
        url: '/admin/getIndustryListByType',
        method: 'post',
        data: {
            token: store.state.token,
            type
        }
    })
}